An Encoding Scheme for Generating λ-Expressions in Genetic Programming
نویسندگان
چکیده
To apply genetic programming (GP) to evolve λ-expressions, we devised an encoding scheme that encodes λ-expressions into trees. This encoding has closure property, i.e., any combination of terminal and non-terminal symbols forms a valid λ-expression. We applied this encoding to a simple symbolic regression problem over Church numerals and the objective function f(x) = 2x was successfully obtained. This encoding scheme will provide a good foothold for exploring fundamental properties of GP by making use of lambda-calculus. In this paper, we give an encoding scheme that encodes λ-expressions into trees, which is appropriate for evolving λ-expressions by genetic programming (GP). A λ-expression is a term in lambda-calculus [2], composed of variables, abstraction and application. Here are some examples of λ-expressions. (λx.(λy.(x(xy)))) (let 2 denote this λ-expression) (λx.(λy.(λz.((xy)(xy)z)))) (let D denote this λ-expression) A λ-expression can be regarded as a program. Giving the input 2 to the program D is represented by applying D to 2 as the following. (D 2 ) ≡ ((λx.(λy.(λz.((xy)(xy)z))))(λx.(λy.(x(xy))))) By several steps of β-reduction, the above λ-expression is rewritten into (λx.(λy.(x(x(x(xy)))))) . (let 4 denote this λ-expression) β-reduction steps can be regarded as the execution of the program, and 4 can be regarded as the output of the execution. If λ-expressions can be represented as trees, GP can evolve λ-expressions. We devised an encoding scheme to handle λ-expressions in GP. This encoding scheme encodes a λ-expression into a tree. The non-terminal symbol L represents abstraction, and the non-terminal symbol P represents application. A terminal symbol is a positive integer and it represents a variable. A variable labeled by an integer n is bound by n-th abstraction in the path from the variable to the root. Example trees are (L 1), (L (L 1)) and (L (L (P 2 1))), which represent λ-expressions (λx.x), (λx.(λy.y)) and (λx.(λy.(xy))), respectively. E. Cantú-Paz et al. (Eds.): GECCO 2003, LNCS 2724, pp. 1814–1815, 2003. c © Springer-Verlag Berlin Heidelberg 2003 An Encoding Scheme for Generating λ-Expressions in Genetic Programming 1815 This encoding scheme has the following good properties. One is that any tree encoded by this scheme is syntactically and semantically valid as a λ-expression. Crossover and mutation always produce valid individuals. Secondly the meaning of a subtree does not change by crossover since relation of a bound variable and the abstraction that binds the variable is preserved under crossover. We applied this encoding to a simple symbolic regression problem. The objective function is f(x) = 2x over Church numerals [2]. Church numerals represent natural numbers; examples are 2 and 4 shown above. The function f can be expressed as a λ-expression in many ways, and D is such a λ-expression. We implemented a β-reduction routine in C and incorporated it to lil-gp [3] to make the whole GP system. Main GP parameters are: population size 1000; maximum generation 1000; 10% reproduction with elites 1%, 89.9% crossover and 0.1% mutation. In the experiment, the objective function D was obtained in 13 out of 25 runs. The transition of the best individuals in a successful run is shown in Table 1 in their canonical forms. The fitness was measured based on structural difference between the correct answer and the output of the individual. The experimental results indicate that the encoding scheme is appropriate for evolving λ-expressions by GP, and thus it will provide a good foothold for exploring fundamental property of GP by using lambda-calculus. Table 1. Example transition of best individuals Generation Fitness Best individual 0 153 (λx.x) 233 150 (λx.(λy.(λz.(z((xy)(yy)))))) 346 147 (λx.(λy.(λz.(z((xy)(y(z(yy)))))))) 365 146 (λx.(λy.(λz.(z((xy)(y(y(yy)))))))) 376 145 (λx.(λy.(λz.(z((xy)(y(y(y(zy))))))))) 401 143 (λx.(λy.(λz.(z((xy)(y(y(y(z(yz)))))))))) 403 82 (λx.(λy.(λz.(z((xy)(y(y((xz)(λw.w))))))))) 414 81 (λx.(λy.(λz.(z((xy)(y((xz)(λw.w)))))))) 420 80 (λx.(λy.(λz.((xy)(y(y((xz)(λw.w)))))))) 422 9 (λx.(λy.(λz.(z((xy)(y(y((xy)(λw.w))))))))) 425 6 (λx.(λy.(λz.((xy)(y(y((xy)(λw.w)))))))) 433 2 (λx.(λy.(λz.((xy)((xy)(λw.w)))))) 439 0 (λx.(λy.(λz.((xy)((xy)z)))))
منابع مشابه
A Genetic Programming-based Scheme for Solving Fuzzy Differential Equations
This paper deals with a new approach for solving fuzzy differential equations based on genetic programming. This method produces some trial solutions and seeks the best of them. If the solution cannot be expressed in a closed analytical form then our method produces an approximation with a controlled level of accuracy. Furthermore, the numerical results reveal the potential of the proposed appr...
متن کاملAerodynamic Design Optimization Using Genetic Algorithm (RESEARCH NOTE)
An efficient formulation for the robust shape optimization of aerodynamic objects is introduced in this paper. The formulation has three essential features. First, an Euler solver based on a second-order Godunov scheme is used for the flow calculations. Second, a genetic algorithm with binary number encoding is implemented for the optimization procedure. The third ingredient of the procedure is...
متن کاملA new security proof for FMNV continuous non-malleable encoding scheme
A non-malleable code is a variant of an encoding scheme which is resilient to tampering attacks. The main idea behind non-malleable coding is that the adversary should not be able to obtain any valuable information about the message. Non-malleable codes are used in tamper-resilient cryptography and protecting memories against tampering attacks. Many different types of non-malleability have alre...
متن کاملAn Efficient Genetic Agorithm for Solving the Multi-Mode Resource-Constrained Project Scheduling Problem Based on Random Key Representation
In this paper, a new genetic algorithm (GA) is presented for solving the multi-mode resource-constrained project scheduling problem (MRCPSP) with minimization of project makespan as the objective subject to resource and precedence constraints. A random key and the related mode list (ML) representation scheme are used as encoding schemes and the multi-mode serial schedule generation scheme (MSSG...
متن کاملAn L1-norm method for generating all of efficient solutions of multi-objective integer linear programming problem
This paper extends the proposed method by Jahanshahloo et al. (2004) (a method for generating all the efficient solutions of a 0–1 multi-objective linear programming problem, Asia-Pacific Journal of Operational Research). This paper considers the recession direction for a multi-objective integer linear programming (MOILP) problem and presents necessary and sufficient conditions to have unbounde...
متن کامل